<template>
  <div class="analysis-container">
    {{ dd }}
    <hr>
    {{ yy }}
    <hr>
    <el-button @click="handleClick">点击</el-button>

    <hr>
    <div> {{ menuList }}</div>
    <div>
      <el-button @click="changeStatus">改变</el-button>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      yy: [true, true, true],
      menuList: [
        { id: 1, age: 1 },
        { id: 2, age: 2 },
        { id: 3, age: 3 }
      ],
      isChange: false
    }
  },
  watch: {
    isChange: {
      handler: 'changeValue',
      immediate: true
    }
  },
  methods: {
    changeStatus() {
      this.isChange = !this.isChange
      console.log(this.isChange)
    },
    changeValue() {
      this.menuList[1] = { id: 2.2, age: 2.2 }
      console.log(this.menuList)
    },
    handleClick() {
      this.yy[1] = !this.yy[1]
    }
  }
}
</script>
